<template>
    <div>
        <van-field v-model="name" label="名称" placeholder="请输入名称" id="name" />
         <van-button color="linear-gradient(to right, #7232dd, #ffffff)" @click="add" style="width:200px" id="add" >
                添加
        </van-button>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                name:'',
            }
        },
        methods:{
            add(){
                this.$axios.post('cateM',{'name':this.name})
                .then(res=>{
                    console.log(res.data)
                    this.$toast.fail('添加成功')

                })
            },
        }
        
    }
</script>

<style scoped>

</style>